package com.tang.utils;

import com.tang.service.impl.BookServiceImpl;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author Tom
 * @ClassName IocUtils
 * @Date 2021/10/30 19:17
 */
public class IocUtils {
 public BookServiceImpl util(){
  ClassPathXmlApplicationContext cal = new ClassPathXmlApplicationContext("ApplicationContext.xml");
  BookServiceImpl bookServiceImpl = (BookServiceImpl) cal.getBean("bookServiceImpl");
  return bookServiceImpl;
 }
}
    